export default {
	state: {
		callTaskTimer: '', //定时任务ID
		callCount:0, //未呼叫的任务数量
		callType:0, //是否自动拨打，0是，1否
		taskType:1, //是否接受任务，0是，1否
		callTaskCountTimer:'', //定时任务，获取未呼叫的数量任务
		voiceServiceList:[], //录音服务列表
		voiceList:[], //待获取录音数据,
        autoCallStatus:0, //任务中的自动外呼状态，0没有自动外呼，1自动外呼
        isSip:0,
        sipPhone:'',
        isShowWebSip:0, //是否需要显示WEBSIP页，0显示，1不显示
        callStatus:0, //通话状态，0通话结束，1通话中，
        websipCallStatus:'',//websip 通话状态  hangup :挂断
        callingData:{id:'',phone:'',type:'',state:''},//通话中的数据  id,phone,type(index,info)
		currentCallType:'', //当前的呼叫方式，back,sip,call,
	},
	mutations: {
		setCallTaskTimer: (state, callTaskTimer) => {
			uni.setStorageSync("callTaskTimer",callTaskTimer);
			state.callTaskTimer = callTaskTimer
		},
		setCallCount: (state, callCount) => {
			uni.setStorageSync("callCount",callCount);
			state.callCount = callCount
		},
		setCallType: (state, callType) => {
			state.callType = callType
		},
		setTaskType: (state, taskType) => {
			uni.setStorageSync("taskType",taskType);
			state.taskType = taskType
		},
		setCallTaskCountTimer: (state, callTaskCountTimer) => {
			uni.setStorageSync("callTaskCountTimer",callTaskCountTimer);
			state.callTaskCountTimer = callTaskCountTimer
		},
		setVoiceServiceList: (state, voiceServiceList) => {
			uni.setStorageSync("voiceServiceList",voiceServiceList);
			state.voiceServiceList = voiceServiceList
		},
		setVoiceList: (state, voiceList) => {
			uni.setStorageSync("voiceList",voiceList);
			state.voiceList = voiceList
		},

        setAutoCallStatus: (state, autoCallStatus) => {
        	uni.setStorageSync("autoCallStatus",autoCallStatus);
        	state.autoCallStatus = autoCallStatus
        },
        
        setIsSip: (state, isSip) => {
        	uni.setStorageSync("isSip",isSip);
        	state.isSip = isSip
        },
        
        setSipPhone: (state, sipPhone) => {
        	uni.setStorageSync("sipPhone",sipPhone);
        	state.sipPhone = sipPhone
        },
        
        setIsShowWebSip: (state, isShowWebSip) => {
        	uni.setStorageSync("isShowWebSip",isShowWebSip);
        	state.isShowWebSip = isShowWebSip
        },
        
        setCallStatus: (state, callStatus) => {
        	uni.setStorageSync("callStatus",callStatus);
        	state.callStatus = callStatus
        },
        
        setWebsipCallStatus: (state, websipCallStatus) => {
        	uni.setStorageSync("websipCallStatus",websipCallStatus);
        	state.websipCallStatus = websipCallStatus
        },
        
        setCallingData: (state, callingData) => {
        	uni.setStorageSync("callingData",callingData);
        	state.callingData = callingData
        },
		
		setCurrentCallType: (state, currentCallType) => {
			uni.setStorageSync("callingData",currentCallType);
			state.currentCallType = currentCallType
		}
	},
	actions: {
		setCallTaskTimer({
			commit
		}, callTaskTimer) {
			commit('setCallTaskTimer', callTaskTimer)
		},
		
		setCallCount({
			commit
		}, callCount) {
			commit('setCallCount', callCount)
		},
		
		setCallType({
			commit
		}, callType) {
			commit('setCallType', callType)
		},
		
		setTaskType({
			commit
		}, taskType) {
			commit('setTaskType', taskType)
		},
		
		setCallTaskCountTimer({
			commit
		}, callTaskCountTimer) {
			commit('setCallTaskCountTimer', callTaskCountTimer)
		},
		
		setVoiceServiceList({
			commit
		}, voiceServiceList) {
			commit('setVoiceServiceList', voiceServiceList)
		},
		
		setVoiceList({
			commit
		}, voiceList) {
			commit('setVoiceList', voiceList)
		},
        
        setAutoCallStatus({
        	commit
        }, autoCallStatus) {
        	commit('setAutoCallStatus', autoCallStatus)
        },
        
        setIsSip({
        	commit
        }, isSip) {
        	commit('setIsSip', isSip)
        },
        
        setSipPhone({
        	commit
        }, sipPhone) {
        	commit('setSipPhone', sipPhone)
        },
        
        setIsShowWebSip({
        	commit
        }, isShowWebSip) {
        	commit('setIsShowWebSip', isShowWebSip)
        },
        
        setCallStatus({
        	commit
        }, callStatus) {
        	commit('setCallStatus', callStatus)
        },
        
        setWebsipCallStatus({
        	commit
        }, websipCallStatus) {
        	commit('setWebsipCallStatus', websipCallStatus)
        },
        
        setCallingData({
        	commit
        }, callingData) {
        	commit('setCallingData', callingData)
        },
		
		setCurrentCallType({
			commit
		}, currentCallType) {
			commit('setCurrentCallType', currentCallType)
		}
	}
}